package com.jing.weibo.scheduler.task;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.jing.system.comm.enums.FansAttentionType;

/**
 * 定时任务Job
 * @author jing.yue
 * @version 2012/09/18 1.0.0
 */
public class TaskJob extends QuartzJobBean {

	private Task task;

	@Override
	protected void executeInternal(JobExecutionContext arg0) throws JobExecutionException {
		String username = (String) arg0.getJobDetail().getJobDataMap().get("username");
		String token = (String) arg0.getJobDetail().getJobDataMap().get("token");
		FansAttentionType fansAttentionType = (FansAttentionType) arg0.getJobDetail().getJobDataMap().get("fansAttentionType");
		task.loadUsernameData(username, token, fansAttentionType);
	}

	public Task getTask() {
		return task;
	}

	public void setTask(Task task) {
		this.task = task;
	}

}
